import { createRouter, createWebHashHistory } from 'vue-router'
import IndexView from '@/views/Home/indexView.vue'
import LoginView from '@/views/Login/LoginView.vue'
import RegisterView from '@/views/Login/RegisterView.vue'
import ForgetPasswdView from '@/views/Login/ForgetPasswdView.vue'
import CountryView from '@/views/Home/countryView.vue'
import RelationView from '@/views/Home/relationView.vue'

const routes = [
  {
    path: '/',
    // name: 'login',
    redirect: '/login'
    // component: LoginView
  },
  {
    path: '/login',
    name: 'login',
    component: LoginView
  },
  {
    path: '/register',
    component: RegisterView
  },
  {
    path: '/forgetpasswd',
    component: ForgetPasswdView
  },
  {
    path: '/index',
    component: IndexView,
    meta: {
      requireAuth: false
    },
  //   children: [
  //     {
  //       path: '/mainhome',
  //       redirect: '/mainhome/dataAnalysis'
  //     },
  //     {
  //       path: 'dataAnalysis',
  //       meta: {
  //         requireAuth: false
  //       },
  //       component: DataAnalysisView
  //     },
  //   ]
  },
  {
    path: '/country',
    name: 'country',
    component: CountryView
  },
  {
    path: '/relation',
    name: 'relation',
    component: RelationView
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
